//将拦截器整体导入
import request from '@/CommonJs/Interceptor'//导入已经写好的拦截器
import axios from 'axios'
// 封装所有的API接口

export function Login(params) {
  console.log(params)
  return request({
    url: '/administrator/login',
    method: 'post',
    params: params,
  })
}
const urlBase = 'http://localhost:4141/his/'

export function getListFun(url, params) {
  return axios({
    url: urlBase + url,
    method: 'get',
    params
  })
}

export function getListMoreFun(url, params){
  return axios({
    url: urlBase + url,
    method: 'post',
    params
  })
}

export function getTotalFun(url, keywords) {
  return axios({
    url: urlBase + url,
    method: 'post',
    params: {
      keywords
    }
  })
}

export function deleteByIdsFun(url, data) {
  return axios({
    url: urlBase + url,
    method: 'post',
    data
  })
}

export function deleteByIdFun(url,id){
  return axios({
    url:urlBase + url,
    method: 'post',
    params:{id}
  })
}

export function addFun(url,params){
  return axios({
    url:urlBase + url,
    method: 'post',
    params
  })
}
export function addBodyFun(url,data){
  return axios({
    url:urlBase + url,
    method: 'post',
    data
  })
}

export function updateFun(url,data){
  return axios({
    url:urlBase + url,
    method: 'post',
    data
  })
}